Skip to content
This repository has been archived by the owner on May 22, 2022. It is now read-only.

properly handle test dependencies #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jtjeferreira
Copy link
Contributor

Uses dependencyOverrides instead of Compile / dependencyOverrides because otherwise it is unused. However to also fix the use case presented in #30, this PR also looks into Test classpath and adds these modules to the dependencyOverrides with the test configuration...

I tested this in my work project and the changes were minimal

@@ -1,8 +1,8 @@
 // DON'T EDIT THIS FILE.
-// This file is auto generated by sbt-lock 0.6.1.
+// This file is auto generated by sbt-lock 0.8.1-SNAPSHOT.
 // https://github.com/tkawachi/sbt-lock/
 dependencyOverrides ++= {
-  if (!(sbtLockHashIsUpToDate in ThisBuild).value && sbtLockIgnoreOverridesOnStaleHash.value) {
+  if (!(ThisBuild / sbtLockHashIsUpToDate).value && sbtLockIgnoreOverridesOnStaleHash.value) {
     Seq.empty
   } else {
     Seq(
@@ -12,6 +12,7 @@ dependencyOverrides ++= {
       "com.beachape" % "enumeratum-macros_2.13" % "1.5.10",
       "com.beachape" % "enumeratum_2.13" % "1.5.14",
       "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.0",
+      "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.8" % "test",
       "com.fasterxml.jackson.core" % "jackson-core" % "2.9.9",
       "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9",
       "com.github.ben-manes.caffeine" % "caffeine" % "2.8.0",
@@ -62,6 +63,7 @@ dependencyOverrides ++= {
       "io.perfmark" % "perfmark-api" % "0.19.0",
       "javax.activation" % "activation" % "1.1",
       "javax.xml.bind" % "jaxb-api" % "2.1",
+      "javax.xml.bind" % "jaxb-api" % "2.3.0" % "test",
       "javax.xml.stream" % "stax-api" % "1.0-2",
       "org.checkerframework" % "checker-qual" % "2.10.0",
       "org.codehaus.mojo" % "animal-sniffer-annotations" % "1.18",

fixes #34

An improvement to this could be adding a new setting to control, how test dependencies should be added:

  1. add all test dependencies (which would handle "test" and "runtime" scoped dependencies missing #28) - not implemented
  2. add only test dependencies where the version is different than compile dependencies - implemented in this PR
  3. do not add test dependencies at all

@jtjeferreira
Copy link
Contributor Author

hi @tkawachi

could you have a look at the PR? do you think I need to improve anything?

@jtjeferreira
Copy link
Contributor Author

hi @tkawachi

any chance to have a look at this?

@nrdxp
Copy link

nrdxp commented May 11, 2022

Can we merge this? The plugin is basically completely broken without it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using compile scope makes dependencyOverrides have no effect
2 participants